﻿<%@ Page Language="C#" MasterPageFile="~/Design/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="NotifyMessageDepartForm.aspx.cs" Inherits="App_Input_NotifyMessageDepartForm" Title="部门列表" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script language="javascript">
        function onCheckDepart(obj) {
            var hidDepartId = document.getElementById("<%=hidDepartId.ClientID %>");
            var s = hidDepartId.value;
            var list = (s.length==0)?new ArrayList():toArrayList(s.split(','));
            var index;

            if( obj.checked && list.contains(obj.value)==false ) {
                list.add(obj.value);
            }
            else if( obj.checked==false && list.contains(obj.value) ) {
                list.remove( list.indexOf(obj.value) );
            }

            var value = list.toArray().toString();
            hidDepartId.value = value;
        }
    </script>

    <asp:GridView ID="GridViewResult" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        CssClass="GridView_table" Width="100%" OnPageIndexChanging="GridViewResult_PageIndexChanging" OnRowDataBound="GridViewResult_RowDataBound"
        >
        <Columns>
            <asp:BoundField HeaderText="部门编号" DataField="DepartId">
                <HeaderStyle CssClass="GridView_head_grayblue" Width="150px" />
                <ItemStyle CssClass="GridView_item_center" />
            </asp:BoundField>
            <asp:BoundField HeaderText="部门名称" DataField="DepartName">
                <HeaderStyle CssClass="GridView_head_grayblue" />
                <ItemStyle CssClass="GridView_item_center" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="选择状态">
                <HeaderStyle CssClass="GridView_head_grayblue" />
                <ItemStyle CssClass="GridView_item_center" Width="65" />
                <ItemTemplate>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerStyle HorizontalAlign="Right" />
    </asp:GridView>
    <a href="#" onclick="selectAll()">全选/</a><a href="#" onclick="cancelAll()">取消</a>
   
    <p>&nbsp;</p>
    <p align="center">
    <asp:HiddenField ID="hidDepartId" runat="server" />
    <asp:Button ID="btnOk" runat="server" Text=" 确 定 " Width="95px" OnClick="btnOk_Click"/>
    <asp:Button ID="Button1" runat="server" Text=" 取 消 " Width="95px" />
    </p>
</asp:Content>

